import Vue from 'vue'
import VueRouter from 'vue-router'
import LayOut from '@/components/cq-layout.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: LayOut,
    children: [
      { path: '/', redirect: '/index' },
      { path: '/index', component: () => import('@/views/home/index.vue') },
      { path: '/news', component: () => import('@/views/news/index.vue') },
      { path: '/apply', component: () => import('@/views/apply/index.vue') },
      { path: '/case', component: () => import('@/views/case/index.vue') },
      { path: '/about', component: () => import('@/views/about/index.vue') },
      { path: '/detail/:id', component: () => import('@/views/detail/index.vue') }
    ]
  },
  { path: '*', component: () => import('@/views/error/index.vue') }
]

const router = new VueRouter({
  routes
})

export default router
